package cn.iocoder.yudao.module.pay.splitting.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumCodable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 分账渠道枚举
 *
 * @author 山野羡民
 */
@Getter
@AllArgsConstructor
public enum SplittingChannelEnum implements EnumCodable {

    Wallet("wallet", "钱包余额分账系统"),
    MallBook("mallbook", "MallBook 分账系统"),
    ;

    private final String code;
    private final String name;

    public static SplittingChannelEnum codeOf(String code) {
        for (SplittingChannelEnum value : values()) {
            if (Objects.equals(value.getCode(), code)) {
                return value;
            }
        }
        return MallBook;
    }

}
